import java.util.Arrays;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        int[] array = {1,2,3,4};
        func1(array);
        func2(array);
        System.out.println(Arrays.toString(array));
        int[] ret = func3();
        System.out.println(Arrays.toString(ret));
        int[] tmp = {1,2};
        System.out.println("交换前："+tmp[0]+" "+tmp[1]);
        swap(tmp);
        System.out.println("交换后："+tmp[0]+" "+tmp[1]);

    }
    private static void swap(int[] array){
        int tmp = array[0];
        array[0] = array[1];
        array[1] = tmp;
    }
    private static int[] func3() {
        int[] tmp = {1,2,3,4,5,6,7};
        return tmp;
    }

    private static void func2(int[] array) {
        array[0] = 99;
    }

    private static void func1(int[] array) {
        array = new int[10];
    }
}